"use strict";
cc._RF.push(module, 'd43afQV2eJOWaVvW2BLx2kV', 'HallCarView');
// scripts/HallCarView.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("CarConstant"),
    s = t("HallConstant"),
    l = t("AssemblyItem"),
    c = t("GlobalUserData"),
    d = t("CarRoleView"),
    h = t("Util"),
    p = t("GameConstant"),
    u = t("Global"),
    f = t("CarUnlock"),
    m = t("Common"),
    _ = cc._decorator,
    y = _.ccclass,
    g = _.property,
    v = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.pfb_role = null, e.pfb_assembly = null, e.node_shadow = null, e.label_Power = null, e.node_content = null, e.spr_tag = null, e.frame_tag = null, e.unlock_tag = null, e.def_tag = null, e.node_lock = null, e.node_superCarTag = null, e.pfb_carUnlock = null, e._hallControl = null, e._nCarIndex = 0, e.roleControl = null, e.equipBodyData = null, e.equipWheelData = [], e.equipWeaponData = [], e.equipToolsData = [], e.equipCarBody = null, e.equipCarWheel = [null, null], e.equipCarWeapon = [null, null], e.equipCarTools = [null, null], e.assemblyView = null, e.equipWheelRadius = 0, e;
  }

  return n(e, t), e.prototype.init = function (t, e) {
    this._hallControl = t, this._nCarIndex = e, this.node_lock.active = !1, c["default"].curEquipBody[e] ? this.refreshView() : (this.spr_tag.spriteFrame = this.unlock_tag, this.node_lock.active = !0);
  }, Object.defineProperty(e.prototype, "IsLock", {
    get: function get() {
      return this.node_lock.active;
    },
    enumerable: !1,
    configurable: !0
  }), e.prototype.showUnlockView = function () {
    var t = cc.instantiate(this.pfb_carUnlock);
    t.getComponent(f["default"]).init(this.unlock.bind(this), this._hallControl, this._nCarIndex), this._hallControl.node.addChild(t);
  }, e.prototype.unlock = function () {
    console.log("车位解锁"), 1 == this._nCarIndex && m["default"].getIns().logEvent(m.LogEventType.Car2Unlock, "", 2), c["default"].saveEquipBodyData(this._nCarIndex, 1), this.node_lock.active = !1, this.spr_tag.spriteFrame = this.def_tag, this.refreshView();
  }, e.prototype.refreshView = function (t) {
    this.node_content.removeAllChildren(), this.createRole(), this.createCarBody(), this.createCarWheel(), this.createCarWeapon(), this.createCarTools(), this.refreshCarPower(), t && (this.spr_tag.spriteFrame = this.frame_tag, this.node_superCarTag.active = !0, this.node_superCarTag.y = this.carBodySize.height / 2 + 60);
  }, e.prototype.setAssemblyView = function (t) {
    this.assemblyView = t;
  }, e.prototype.onShowHall = function () {
    this.refreshCarPower(), this.roleControl && this.roleControl.playAniIn();
    var t = !!c["default"].curEquipWheel[this._nCarIndex][0],
        e = !!c["default"].curEquipWheel[this._nCarIndex][1];
    this.equipCarBody && this.equipCarBody.updateItem(null, !0, 0, this.equipBodyData, !1, l.Assembly_Type.Hall, t, e);

    for (var o = 0; o < this.equipWheelData.length; o++) {
      this.equipWheelData[o] && this.equipCarWheel[o] && this.equipCarWheel[o].updateItem(null, !0, 0, this.equipWheelData[o], !1, l.Assembly_Type.Hall);
    }

    for (o = 0; o < this.equipWeaponData.length; o++) {
      this.equipWeaponData[o] && this.equipCarWeapon[o] && this.equipCarWeapon[o].updateItem(null, !0, 0, this.equipWeaponData[o], !1, l.Assembly_Type.Hall);
    }

    for (o = 0; o < this.equipToolsData.length; o++) {
      this.equipToolsData[o] && this.equipCarTools[o] && this.equipCarTools[o].updateItem(null, !0, 0, this.equipToolsData[o], !1, l.Assembly_Type.Hall);
    }
  }, e.prototype.refreshCarPower = function () {
    var t = 0;
    t += h.Util.getOwnItemPower(this.equipBodyData);

    for (var e = 0; e < this.equipWheelData.length; e++) {
      var o = this.equipWheelData[e];
      t += h.Util.getOwnItemPower(o);
    }

    for (e = 0; e < this.equipWeaponData.length; e++) {
      o = this.equipWeaponData[e], t += h.Util.getOwnItemPower(o);
    }

    for (e = 0; e < this.equipToolsData.length; e++) {
      o = this.equipToolsData[e], t += h.Util.getOwnItemPower(o);
    }

    this.label_Power.string = "战力：" + t.toString();
  }, e.prototype.onShowAssembly = function () {
    this.roleControl && this.roleControl.playAniOut();
    var t = !!c["default"].curEquipWheel[this._nCarIndex][0],
        e = !!c["default"].curEquipWheel[this._nCarIndex][1];
    this.equipCarBody && this.equipCarBody.updateItem(this.assemblyView, !0, 0, this.equipBodyData, !1, l.Assembly_Type.Hall, t, e);

    for (var o = 0; o < this.equipWheelData.length; o++) {
      this.equipWheelData[o] && this.equipCarWheel[o] && this.equipCarWheel[o].updateItem(this.assemblyView, !0, 0, this.equipWheelData[o], !0, l.Assembly_Type.Hall);
    }

    for (o = 0; o < this.equipWeaponData.length; o++) {
      this.equipWeaponData[o] && this.equipCarWeapon[o] && this.equipCarWeapon[o].updateItem(this.assemblyView, !0, 0, this.equipWeaponData[o], !0, l.Assembly_Type.Hall);
    }

    for (o = 0; o < this.equipToolsData.length; o++) {
      this.equipToolsData[o] && this.equipCarTools[o] && this.equipCarTools[o].updateItem(this.assemblyView, !0, 0, this.equipToolsData[o], !0, l.Assembly_Type.Hall);
    }
  }, e.prototype.getAssemblyItem = function (t) {
    var e = null;

    switch (t) {
      case r.Basics_Items_Type.body:
        e = this.equipCarBody;
        break;

      case r.Basics_Items_Type.wheel:
        for (var o = 0; o < this.equipCarWheel.length; o++) {
          null != this.equipCarWheel[o] && "" != this.equipWheelData[o] && (e = this.equipCarWheel[o]);
        }

        break;

      case r.Basics_Items_Type.weapon:
        for (o = 0; o < this.equipCarWeapon.length; o++) {
          null != this.equipCarWeapon[o] && "" != this.equipWeaponData[o] && (e = this.equipCarWeapon[o]);
        }

        break;

      case r.Basics_Items_Type.tools:
        for (o = 0; o < this.equipCarTools.length; o++) {
          null != this.equipCarTools[o] && "" != this.equipToolsData[o] && (e = this.equipCarTools[o]);
        }

    }

    return e;
  }, e.prototype.createRole = function () {
    var t = h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex]);

    if (t) {
      if (!this.roleControl) {
        var e = cc.instantiate(this.pfb_role);
        this.node_content.addChild(e), this.roleControl = e.getComponent(d["default"]);
      }

      this.roleControl.init(this, p.Physics_Car_Tag.Left, t);
    }
  }, e.prototype.createCarBody = function () {
    var t = h.Util.getBodyData(c["default"].curEquipBody[this._nCarIndex]);
    this.equipBodyData = t;
    var e = cc.instantiate(this.pfb_assembly);
    this.carBodySize = e.getContentSize(), this.node_content.addChild(e), this.equipCarBody = e.getComponent(l.AssemblyItem);
    var o = !!c["default"].curEquipWheel[this._nCarIndex][0],
        i = !!c["default"].curEquipWheel[this._nCarIndex][0];
    this.equipCarBody.updateItem(null, !0, 0, t, !1, l.Assembly_Type.Hall, o, i), t && this.showShadow(t.id, c["default"].curEquipWheel[this._nCarIndex][0], c["default"].curEquipWheel[this._nCarIndex][1]);
  }, e.prototype.createCarWheel = function () {
    for (var t = 0; t < c["default"].curEquipWheel[this._nCarIndex].length; t++) {
      var e = h.Util.getWheelData(c["default"].curEquipWheel[this._nCarIndex][t]);

      if (e) {
        this.equipWheelData[t] = e, this.equipWheelRadius = this.equipWheelRadius < e.radius && e.radius;
        var o = cc.instantiate(this.pfb_assembly);
        this.node_content.addChild(o, 20), o.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).wheelPos[t], this.equipCarWheel[t] = o.getComponent(l.AssemblyItem), this.equipCarWheel[t].updateItem(null, !0, 0, e, !1, l.Assembly_Type.Hall);
      } else this.equipWheelData[t] = null, this.equipCarWheel[t] = null;
    }
  }, e.prototype.createCarWeapon = function () {
    for (var t = 0; t < c["default"].curEquipWeapon[this._nCarIndex].length; t++) {
      var e = h.Util.getWeaponData(c["default"].curEquipWeapon[this._nCarIndex][t]);

      if (e) {
        this.equipWeaponData[t] = e;
        var o = cc.instantiate(this.pfb_assembly);
        this.node_content.addChild(o, 30), o.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).weaponPos[t], this.equipCarWeapon[t] = o.getComponent(l.AssemblyItem), this.equipCarWeapon[t].updateItem(null, !0, 0, e, !1, l.Assembly_Type.Hall);
      } else this.equipWeaponData[t] = null, this.equipCarWeapon[t] = null;
    }
  }, e.prototype.createCarTools = function () {
    for (var t = 0; t < c["default"].curEquipTools[this._nCarIndex].length; t++) {
      var e = h.Util.getToolsData(c["default"].curEquipTools[this._nCarIndex][t]);

      if (e) {
        this.equipToolsData[t] = e;
        var o = cc.instantiate(this.pfb_assembly);
        this.node_content.addChild(o, 40), o.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).toolsPos[t], this.equipCarTools[t] = o.getComponent(l.AssemblyItem), this.equipCarTools[t].updateItem(null, !0, 0, e, !1, l.Assembly_Type.Hall);
      } else this.equipToolsData[t] = null, this.equipCarTools[t] = null;
    }
  }, e.prototype.showShadow = function (t, e, o) {
    var i = 0,
        n = 0;

    if (e) {
      var a = h.Util.getWheelData(e).id;
      i = r.GetCarWheelData(a).radius;
    }

    if (o) {
      var s = h.Util.getWheelData(o).id;
      n = r.GetCarWheelData(s).radius;
    }

    i > n && (n = i), n /= 4;
    var l = r.GetCarBodyData(t),
        c = l.hallPos;
    this.node.position = cc.v3(c.x, c.y + n, c.z), this.node_shadow.position = cc.v3(l.shadowPos.x, l.shadowPos.y - n, l.shadowPos.z);
  }, e.prototype.onEquipCarItem = function (t, e, o, i) {
    switch (o) {
      case r.colliderTag.Hall.body:
        this.updateItemsPos();
        break;

      case r.colliderTag.Hall.wheel:
        this.onEquipWheel(t, e, i, !0);
        break;

      case r.colliderTag.Hall.weapon:
        this.onEquipWeapon(t, e);
        break;

      case r.colliderTag.Hall.tools:
        this.onEquipTools(t, e);
        break;

      case r.colliderTag.assembly.body:
        this.onEquipBody(t, e);
        break;

      case r.colliderTag.assembly.wheel:
        this.onEquipWheel(t, e, i, !1);
        break;

      case r.colliderTag.assembly.weapon:
        this.onEquipWeapon(t, e);
        break;

      case r.colliderTag.assembly.tools:
        this.onEquipTools(t, e);
    }

    this.refreshCarPower();
  }, e.prototype.onEquipWheel = function (t, e, o, i) {
    if (t) {
      if (i) {
        this.equipWheelData[o] && t != this.equipWheelData[o].uid && (c["default"].saveEquipWheelData(this._nCarIndex, o, 0), this.equipWheelData[o] = "", this.equipCarWheel[o].onActive(!1));

        for (var n = 0; n < this.equipWheelData.length; n++) {
          if (this.equipWheelData[n] && t == this.equipWheelData[n].uid) {
            c["default"].saveEquipWheelData(this._nCarIndex, n, 0), this.equipWheelData[n] = "", this.equipCarWheel[n].onActive(!1);
            break;
          }
        }
      }

      this.clearAssemblyBuff(this.equipWheelData[o]), this.playAudio(s.Audio_ID.item_install_success);
      var a = h.Util.getWheelData(t);
      if (this.setAssemblyBuff(a), c["default"].saveEquipWheelData(this._nCarIndex, o, t), this.equipWheelData[o] = a, this.equipCarWheel[o]) this.equipCarWheel[o].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).wheelPos[o], this.equipCarWheel[o].onActive(!0), this.equipCarWheel[o].updateItem(this.assemblyView, !0, 0, a, !0, l.Assembly_Type.Hall), this.equipCarWheel[o].onLightActivie(!0, !0);else {
        var d = cc.instantiate(this.pfb_assembly);
        this.node.addChild(d, 30), d.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).wheelPos[o], this.equipCarWheel[o] = d.getComponent(l.AssemblyItem), this.equipCarWheel[o].onActive(!0), this.equipCarWheel[o].updateItem(this.assemblyView, !0, 0, a, !0, l.Assembly_Type.Hall), this.equipCarWheel[o].onLightActivie(!0, !0);
      }
    }

    if (e) for (n = 0; n < this.equipWheelData.length; n++) {
      this.equipWheelData[n] && this.equipWheelData[n].uid == e && (this.clearAssemblyBuff(this.equipWheelData[n]), this.playAudio(s.Audio_ID.item_drop), c["default"].saveEquipWheelData(this._nCarIndex, n, 0), this.equipWheelData[n] = "", this.equipCarWheel[n].onActive(!1));
    }
    this.showShadow(this.equipBodyData.id, this.equipWheelData[0] && this.equipWheelData[0].uid || 0, this.equipWheelData[1] && this.equipWheelData[1].uid || 0);
  }, e.prototype.onEquipWeapon = function (t, e) {
    if (t) {
      for (var o = !1, i = 0; i < this.equipWeaponData.length; i++) {
        this.equipWeaponData[i] && this.equipWeaponData[i].uid == t && (this.equipCarWeapon[0].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).weaponPos[0], o = !0);
      }

      if (!o) {
        var n = h.Util.getWeaponData(t);
        if (!this.isElecEquip(r.Basics_Items_Type.weapon, 0, n)) return;

        if (this.playAudio(s.Audio_ID.item_install_success), n) {
          if (this.setAssemblyBuff(n), c["default"].saveEquipWeaponData(this._nCarIndex, 0, t), this.clearAssemblyBuff(this.equipWeaponData[0]), this.equipWeaponData[0] = n, this.equipCarWeapon[0]) this.equipCarWeapon[0].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).weaponPos[0], this.equipCarWeapon[0].updateItem(this.assemblyView, !0, 0, n, !0, l.Assembly_Type.Hall), this.equipCarWeapon[0].onLightActivie(!0, !0);else {
            var a = cc.instantiate(this.pfb_assembly);
            this.node.addChild(a, 30), a.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).weaponPos[0], this.equipCarWeapon[0] = a.getComponent(l.AssemblyItem), this.equipCarWeapon[0].updateItem(this.assemblyView, !0, 0, n, !0, l.Assembly_Type.Hall), this.equipCarWeapon[0].onLightActivie(!0, !0);
          }
        } else this.equipWeaponData[0] = null, this.equipCarWeapon[0] = null;
      }
    }

    if (e) for (o = !1, i = 0; i < this.equipWeaponData.length; i++) {
      this.equipWeaponData[i] && this.equipWeaponData[i].uid == e && (this.clearAssemblyBuff(this.equipWeaponData[i]), this.playAudio(s.Audio_ID.item_drop), o = !0, c["default"].saveEquipWeaponData(this._nCarIndex, i, 0), this.equipWeaponData[i] = "", this.equipCarWeapon[i].onActive(!1));
    }
  }, e.prototype.onEquipTools = function (t, e) {
    if (t) {
      for (var o = !1, i = 0; i < this.equipToolsData.length; i++) {
        this.equipToolsData[i] && this.equipToolsData[i].uid == t && (this.clearAssemblyBuff(this.equipToolsData[i]), this.equipCarTools[0].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).toolsPos[0], o = !0);
      }

      if (!o) {
        var n = h.Util.getToolsData(t);
        if (!this.isElecEquip(r.Basics_Items_Type.tools, 0, n)) return;

        if (this.playAudio(s.Audio_ID.item_install_success), n) {
          if (this.setAssemblyBuff(n), c["default"].saveEquipToolsData(this._nCarIndex, 0, t), this.clearAssemblyBuff(this.equipToolsData[0]), this.equipToolsData[0] = n, this.equipCarTools[0]) this.equipCarTools[0].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).toolsPos[0], this.equipCarTools[0].updateItem(this.assemblyView, !0, 0, n, !0, l.Assembly_Type.Hall), this.equipCarTools[0].onLightActivie(!0, !0);else {
            var a = cc.instantiate(this.pfb_assembly);
            this.node.addChild(a, 30), a.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).toolsPos[0], this.equipCarTools[0] = a.getComponent(l.AssemblyItem), this.equipCarTools[0].updateItem(this.assemblyView, !0, 0, n, !0, l.Assembly_Type.Hall), this.equipCarTools[0].onLightActivie(!0, !0);
          }
        } else this.equipToolsData[0] = null, this.equipCarTools[0] = null;
      }
    }

    if (e) for (o = !1, i = 0; i < this.equipToolsData.length; i++) {
      this.equipToolsData[i] && this.equipToolsData[i].uid == e && (this.clearAssemblyBuff(this.equipToolsData[i]), this.playAudio(s.Audio_ID.item_drop), o = !0, c["default"].saveEquipToolsData(this._nCarIndex, i, 0), this.equipToolsData[i] = "", this.equipCarTools[i].onActive(!1));
    }
  }, e.prototype.onEquipBody = function (t) {
    if (t) {
      for (var e = 0; e < this.equipWheelData.length; e++) {
        this.equipWheelData[e] && (c["default"].saveEquipWheelData(this._nCarIndex, e, 0), this.equipWheelData[e] = "", this.equipCarWheel[e].onActive(!1));
      }

      for (e = 0; e < this.equipWeaponData.length; e++) {
        this.equipWeaponData[e] && (c["default"].saveEquipWeaponData(this._nCarIndex, e, 0), this.equipWeaponData[e] = "", this.equipCarWeapon[e].onActive(!1));
      }

      for (e = 0; e < this.equipToolsData.length; e++) {
        this.equipToolsData[e] && (c["default"].saveEquipToolsData(this._nCarIndex, e, 0), this.equipToolsData[e] = "", this.equipCarTools[e].onActive(!1));
      }

      c["default"].saveEquipBodyData(this._nCarIndex, t);
      var o = h.Util.getBodyData(t);

      if (this.equipBodyData = o, !this.equipCarBody) {
        var i = cc.instantiate(this.pfb_assembly);
        this.node.addChild(i), this.equipCarBody = i.getComponent(l.AssemblyItem);
      }

      var n = !!c["default"].curEquipWheel[this._nCarIndex][0],
          a = !!c["default"].curEquipWheel[this._nCarIndex][0];
      this.playAudio(s.Audio_ID.item_install_success), this.equipCarBody.updateItem(this.assemblyView, !0, 0, o, !1, l.Assembly_Type.Hall, n, a), this.equipCarBody.onLightActivie(!0, !0), this.roleControl && this.roleControl.updateView(!0, o.id), this.showShadow(o.id, null, null);
    }
  }, e.prototype.updateItemsPos = function () {
    for (var t = 0; t < this.equipWeaponData.length; t++) {
      this.equipWeaponData[t] && this.equipWeaponData[t].id && (this.equipCarWeapon[t].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).weaponPos[0]);
    }

    for (t = 0; t < this.equipToolsData.length; t++) {
      this.equipToolsData[t] && this.equipToolsData[t].id && (this.equipCarTools[t].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).toolsPos[0]);
    }

    for (t = 0; t < this.equipWheelData.length; t++) {
      this.equipWheelData[t] && this.equipWheelData[t].id && (this.equipCarWheel[t].node.position = r.GetCarBodyData(h.Util.getBodyId(c["default"].curEquipBody[this._nCarIndex])).wheelPos[t]);
    }
  }, e.prototype.setAssemblyBuff = function (t) {
    null != t && null != this.equipBodyData.buff && null != this.equipBodyData.buff.id && t.id == this.equipBodyData.buff.id && (cc.log("可以buff加成"), this.equipBodyData.buff.buffType == u.BuffType.damage ? t.damage = Math.ceil(t.damage * this.equipBodyData.buff.number) : t.hp = Math.ceil(t.hp * this.equipBodyData.buff.number));
  }, e.prototype.clearAssemblyBuff = function (t) {
    null != t && null != this.equipBodyData.buff && null != this.equipBodyData.buff.id && t.id == this.equipBodyData.buff.id && (this.equipBodyData.buff.buffType == u.BuffType.damage ? t.damage = Math.floor(t.damage / this.equipBodyData.buff.number) : t.hp = Math.floor(t.hp / this.equipBodyData.buff.number));
  }, e.prototype.isElecEquip = function (t, e, o) {
    if (this.equipBodyData) {
      var i = this.equipBodyData.elec;

      if (i -= o.elec, t == r.Basics_Items_Type.weapon) {
        for (var n = 0; n < this.equipWeaponData.length; n++) {
          n != e && this.equipWeaponData[n] && this.equipWeaponData[n].elec && (i -= this.equipWeaponData[n].elec);
        }

        for (n = 0; n < this.equipToolsData.length; n++) {
          this.equipToolsData[n] && this.equipToolsData[n].elec && (i -= this.equipToolsData[n].elec);
        }
      } else if (t == r.Basics_Items_Type.tools) {
        for (n = 0; n < this.equipWeaponData.length; n++) {
          this.equipWeaponData[n] && this.equipWeaponData[n].elec && (i -= this.equipWeaponData[n].elec);
        }

        for (n = 0; n < this.equipToolsData.length; n++) {
          n != e && this.equipToolsData[n] && this.equipToolsData[n].elec && (i -= this.equipToolsData[n].elec);
        }
      }

      return !(i < 0 && (this.playAudio(s.Audio_ID.item_install_fail), this.assemblyView && this.assemblyView.onShowEquipHint(i), 1));
    }
  }, e.prototype.showCarWheelFrame = function (t) {
    if (t) {
      this.equipCarBody && this.equipCarBody.showCarWheelFrame([!0, !0], !0);

      for (var e = 0; e < c["default"].curEquipWheel[this._nCarIndex].length; e++) {
        c["default"].curEquipWheel[this._nCarIndex][e] && this.equipCarWheel[e] && this.equipCarWheel[e].setItemOpacity(0);
      }
    } else {
      var o = [!0, !0];

      for (e = 0; e < c["default"].curEquipWheel[this._nCarIndex].length; e++) {
        c["default"].curEquipWheel[this._nCarIndex][e] && (o[e] = !1, this.equipCarWheel[e] && this.equipCarWheel[e].setItemOpacity(255));
      }

      this.equipCarBody && this.equipCarBody.showCarWheelFrame(o, !1);
    }
  }, e.prototype.showCarWeaponFrame = function (t) {
    if (t) {
      this.equipCarBody && this.equipCarBody.showWeaponFrame([!0, !1], !0);

      for (var e = 0; e < c["default"].curEquipWeapon[this._nCarIndex].length; e++) {
        c["default"].curEquipWeapon[this._nCarIndex][e] && this.equipCarWeapon[e] && this.equipCarWeapon[e].setItemOpacity(0);
      }
    } else {
      var o = [!0, !0];

      for (e = 0; e < c["default"].curEquipWeapon[this._nCarIndex].length; e++) {
        c["default"].curEquipWeapon[this._nCarIndex][e] && (o[e] = !1, this.equipCarWeapon[e] && this.equipCarWeapon[e].setItemOpacity(255));
      }

      this.equipCarBody && this.equipCarBody.showWeaponFrame(o, !1);
    }
  }, e.prototype.showCarToolsFrame = function (t) {
    if (t) {
      this.equipCarBody && this.equipCarBody.showToolsFrame([!0, !1], !0);

      for (var e = 0; e < c["default"].curEquipTools[this._nCarIndex].length; e++) {
        c["default"].curEquipTools[this._nCarIndex][e] && this.equipCarTools[e] && this.equipCarTools[e].setItemOpacity(0);
      }
    } else {
      var o = [!0, !0];

      for (e = 0; e < c["default"].curEquipTools[this._nCarIndex].length; e++) {
        c["default"].curEquipTools[this._nCarIndex][e] && (o[e] = !1, this.equipCarTools[e] && this.equipCarTools[e].setItemOpacity(255));
      }

      this.equipCarBody && this.equipCarBody.showToolsFrame(o, !1);
    }
  }, e.prototype.hideCarWheelFrame = function () {
    var t = !!c["default"].curEquipWheel[this._nCarIndex][0],
        e = !!c["default"].curEquipWheel[this._nCarIndex][0];
    this.equipCarBody && this.equipCarBody.updateItem(null, !0, 0, this.equipBodyData, !1, l.Assembly_Type.Hall, t, e);
  }, e.prototype.playAudio = function (t) {
    this._hallControl.playAudio(t);
  }, e.prototype.onLightActivie = function (t) {
    if (t) ;else {
      this.equipCarBody && this.equipCarBody.onLightActivie(!1);

      for (var e = 0; e < this.equipCarWheel.length; e++) {
        this.equipCarWheel[e] && this.equipCarWheel[e].onLightActivie(!1);
      }

      for (e = 0; e < this.equipCarWeapon.length; e++) {
        this.equipCarWeapon[e] && this.equipCarWeapon[e].onLightActivie(!1);
      }

      for (e = 0; e < this.equipCarTools.length; e++) {
        this.equipCarTools[e] && this.equipCarTools[e].onLightActivie(!1);
      }
    }
  }, a([g(cc.Prefab)], e.prototype, "pfb_role", void 0), a([g(cc.Prefab)], e.prototype, "pfb_assembly", void 0), a([g(cc.Node)], e.prototype, "node_shadow", void 0), a([g(cc.Label)], e.prototype, "label_Power", void 0), a([g(cc.Node)], e.prototype, "node_content", void 0), a([g(cc.Sprite)], e.prototype, "spr_tag", void 0), a([g(cc.SpriteFrame)], e.prototype, "frame_tag", void 0), a([g(cc.SpriteFrame)], e.prototype, "unlock_tag", void 0), a([g(cc.SpriteFrame)], e.prototype, "def_tag", void 0), a([g(cc.Node)], e.prototype, "node_lock", void 0), a([g(cc.Node)], e.prototype, "node_superCarTag", void 0), a([g(cc.Prefab)], e.prototype, "pfb_carUnlock", void 0), a([y], e);
}(cc.Component);

o["default"] = v;

cc._RF.pop();